package day04;

import java.util.Scanner;

public class EmailGetId {
    public static void main(String[] args) {
        String email = new Scanner(System.in).nextLine();
        String id = getid(email);
        if (id != "-1")
            System.out.println("用户的id为" + id);
        else
            System.out.println("格式错误");

    }

    public static String getid(String em) {
        StringBuilder id = new StringBuilder();
        for (int i = 0; i < em.length(); i++) {
            if (em.charAt(i) == '@') {
                return id.toString();
            }
            id.append(em.charAt(i));
        }
        return "-1";

    }
}
